<!doctype html>
<html lang="en" class="fixed sidebar-left-collapsed" xmlns:th="http://www.thymeleaf.org">
<head>

    <!-- Basic -->
    <meta charset="UTF-8">

    <title>分配权限</title>

    <!-- Web Fonts  -->
    <link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800|Shadows+Into+Light" rel="stylesheet" type="text/css">

    <!-- Vendor CSS -->
    <link rel="stylesheet" th:href="@{/vendor/bootstrap/css/bootstrap.css}" />
    <link rel="stylesheet" th:href="@{/vendor/font-awesome/css/font-awesome.css}" />
    <link rel="stylesheet" th:href="@{/vendor/magnific-popup/magnific-popup.css}" />
    <link rel="stylesheet" th:href="@{/vendor/bootstrap-datepicker/css/datepicker3.css}" />

    <!-- Theme CSS -->
    <link rel="stylesheet" th:href="@{/stylesheets/theme.css}" />

    <!-- Skin CSS -->
    <link rel="stylesheet" th:href="@{/stylesheets/skins/default.css}" />

    <!-- Theme Custom CSS -->
    <link rel="stylesheet" th:href="@{/stylesheets/theme-custom.css}">

    <!-- Head Libs -->
    <script th:src="@{/vendor/modernizr/modernizr.js}"></script>

</head>
<body>
<section class="body">

    <!-- 头部 -->
    <div th:replace="~{commons/commons::header}"></div>

    <div class="inner-wrapper">

        <!-- 左侧边栏 -->
        <div th:replace="~{commons/commons::sidebar-admin}"></div>

        <!-- 主体 -->
        <section role="main" class="content-body">
            <header class="page-header">
                <h2>分配权限</h2>

                <div class="right-wrapper pull-right">
                    <ol class="breadcrumbs">
                        <li>
                            <a href="../index.html">
                                <i class="fa fa-home"></i>
                            </a>
                        </li>
                        <li><span>管理员管理</span></li>
                        <li><span>分配权限</span></li>
                    </ol>

                    <a class="sidebar-right-toggle" data-open="sidebar-right"><i class="fa fa-chevron-left"></i></a>
                </div>
            </header>

            <!-- start: page -->

            <div class="row">
                <div class="col-lg-12">
                    <section class="panel">
                        <header class="panel-heading">
                            <div class="panel-actions">
                                <a href="#" class="fa fa-caret-down"></a>
                                <a href="#" class="fa fa-times"></a>
                            </div>

                            <h2 class="panel-title">分配权限</h2>
                        </header>
                        <div class="panel-body">
                            <form th:action="@{/assignPermissions}" class="form-horizontal form-bordered" method="post">
                                <div class="form-group">
                                    <div class="form-group">
                                        <label class="col-md-3 control-label" for="adminId">管理员名(管理员账号)</label>
                                        <div class="col-md-6">
                                            <select onchange="mbar(this)" class="form-control mb-md" name="adminId" id="adminId">
                                                <option th:selected="${adminId.equals(admin.getAdminId())}"
                                                        th:each="admin:${admins}" th:text="${admin.getName() + '(' + admin.getAdminId() +  ')'}" th:value="${admin.getAdminId()}"></option>
                                            </select>
                                        </div>
                                    </div>

                                    <script type="text/javascript">
                                        function mbar(sobj) {
                                            var docurl ="/assign_permissions/" + sobj.options[sobj.selectedIndex].value;
                                            if (docurl != "") {
                                                open(docurl,'_self');
                                                sobj.selectedIndex=0;
                                                sobj.blur();
                                            }
                                        }
                                    </script>

                                    <label class="col-md-4 control-label"></label>
                                    <div class="col-md-6">
                                        <div class="row">
                                            <label class="col-md-3">学员管理</label>
                                            <label>
                                                <input type="radio" name="l1" id="l11" value="1" th:checked="${'1'.equals(l1.trim())}">
                                                是
                                            </label>
                                            <label>
                                                <input type="radio" name="l1" id="l12" value="0" th:checked="${'0'.equals(l1.trim())}">
                                                否
                                            </label>
                                        </div>

                                        <div class="row">
                                            <label class="col-md-3">教练管理</label>
                                            <label>
                                                <input type="radio" name="l2" id="l21" value="1" th:checked="${'1'.equals(l2.trim())}">
                                                是
                                            </label>
                                            <label>
                                                <input type="radio" name="l2" id="l22" value="0" th:checked="${'0'.equals(l2.trim())}">
                                                否
                                            </label>
                                        </div>

                                        <div class="row">
                                            <label class="col-md-3">车辆管理</label>
                                            <label>
                                                <input type="radio" name="l3" id="l31" value="1" th:checked="${'1'.equals(l3.trim())}">
                                                是
                                            </label>
                                            <label>
                                                <input type="radio" name="l3" id="l32" value="0" th:checked="${'0'.equals(l3.trim())}">
                                                否
                                            </label>
                                        </div>

                                        <div class="row">
                                            <label class="col-md-3">信息统计分析</label>
                                            <label>
                                                <input type="radio" name="l4" id="l41" value="1" th:checked="${'1'.equals(l4.trim())}">
                                                是
                                            </label>
                                            <label>
                                                <input type="radio" name="l4" id="l42" value="0" th:checked="${'0'.equals(l4.trim())}">
                                                否
                                            </label>
                                        </div>

                                        <p></p>
                                        <div class="row">
                                            <label class="col-md-3"></label>
                                            <p style="color:red;font-size: large;" th:text="${msg}"></p>
                                        </div>
                                        <p></p>

                                        <label class="col-md-1 control-label"></label>
                                        <div class="row">
                                            <button type="submit" class="btn btn-primary">确定</button>
                                            <button type="reset" class="btn btn-default">重置</button>
                                            <a th:href="@{/admin_info}" class="btn btn-default">取消</a>
                                        </div>

                                    </div>
                                </div>

                            </form>
                        </div>
                    </section>

                </div>
            </div>

            <!-- end: page -->
        </section>
    </div>

    <!-- 右侧边栏 -->
    <div th:replace="~{commons/commons::sidebar-right}"></div>
</section>

<!-- Vendor -->
<script th:src="@{vendor/jquery/jquery.js}"></script>
<script th:src="@{vendor/jquery-browser-mobile/jquery.browser.mobile.js}"></script>
<script th:src="@{/vendor/bootstrap/js/bootstrap.js}"></script>
<script th:src="@{vendor/nanoscroller/nanoscroller.js}"></script>
<script th:src="@{vendor/bootstrap-datepicker/js/bootstrap-datepicker.js}"></script>
<script th:src="@{vendor/magnific-popup/magnific-popup.js}"></script>
<script th:src="@{vendor/jquery-placeholder/jquery.placeholder.js}"></script>

<!-- Specific Page Vendor -->

<!-- Theme Base, Components and Settings -->
<script th:src="@{/javascripts/theme.js}"></script>

<!-- Theme Custom -->
<script th:src="@{/javascripts/theme.custom.js}"></script>

<!-- Theme Initialization Files -->
<script th:src="@{/javascripts/theme.init.js}"></script>

</body>
</html>